<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 28644
  Date: 2022/7/30
  Time: 9:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<style>
    body{
        /* 设置背景渐变 */
        background-image: linear-gradient(to left,
        #9c88ff,#3cadeb);
        display: flex;
        justify-content: center;
    }
    .a{
        position:relative;
        top: 100px;
        width: 1100px;
        height: 550px;
        box-shadow: 0 5px 15px rgba(0,0,0,.8);
        display: flex;
    }
    .b{
        width: 1100px;
        height: 550px;
    }
    table tr td {
        text-align: center;
    }
    .inputstyle{
        width: 90px;
    }
    <%@ include file="/pages/common/a_style.jsp"%>
</style>
<body>
<div class="a">

    <div class="b">

        <table style="margin: 0 auto; width: 1100px;">
            <p style="text-align: center; color: red">${msg}</p>
            <tr>
                <td>ID</td>
                <td>车牌</td>
                <td>品牌</td>
                <td>模型</td>
                <td>颜色</td>
                <td>款式</td>
                <td>排量</td>
                <td>价格</td>
                <td>价格/小时</td>
                <td>状态</td>
                <td>可用</td>
                <td>操作</td>
            </tr>
                <tr>
                    <form action="/Admin/CarServlet?action=add" method="post">
                        <c:if test="${cars.status == 1}">
                            <input type="hidden" value="${cars.car_Id}" name="car_Id">
                            <input type="hidden" value="${cars.car_Number}" name="car_Number">
                            <input type="hidden" value="${cars.brand_Name}" name="brand_Name">
                            <input type="hidden" value="${cars.model}" name="model">
                            <input type="hidden" value="${cars.color}" name="color">
                            <input type="hidden" value="${cars.category_Name}" name="category_Name">
                            <input type="hidden" value="${cars.t_Comments}" name="t_Comments">
                            <input type="hidden" value="${cars.price}" name="price">
                            <input type="hidden" value="${cars.rent}" name="rent">
                            <td>${cars.car_Id}</td>
                            <td>${cars.car_Number}</td>
                            <td>${cars.brand_Name}</td>
                            <td>${cars.model}</td>
                            <td>${cars.color}</td>
                            <td>${cars.category_Name}</td>
                            <td>${cars.t_Comments}</td>
                            <td>${cars.price}</td>
                            <td>${cars.rent}</td>
                            <td>
                                <c:if test="${cars.status == 0}">
                                    未出租
                                    <input type="hidden" value="未出租" name="status">
                                </c:if>

                                <c:if test="${cars.status == 1}">
                                    出租
                                    <input type="hidden" value="出租" name="status">
                                </c:if>

                            </td>
                            <td><select name="useAble">
                                <c:if test="${cars.useAble == 0}">
                                    <option selected="selected">可用</option>
                                    <option>不可用</option>
                                </c:if>

                                <c:if test="${cars.useAble == 1}">
                                    <option>可用</option>
                                    <option selected="selected">不可用</option>
                                </c:if>
                            </select>
                            </td>
                        </c:if>
                        <c:if test="${cars.status == 0}">
                        <td>${cars.car_Id}</td>
                        <td><input type="text" value="${cars.car_Number}"class="inputstyle" name="car_Number"></td>
                        <td><input type="text" value="${cars.brand_Name}"class="inputstyle" name="brand_Name"></td>
                        <td><input type="text" value="${cars.model}"class="inputstyle" name="model"></td>
                        <td><input type="text" value="${cars.color}"class="inputstyle" name="color"></td>
                        <td><input type="text" value="${cars.category_Name}"class="inputstyle" name="category_Name"></td>
                        <td><input type="text" value="${cars.t_Comments}"class="inputstyle" name="t_Comments"></td>
                        <td><input type="text" value="${cars.price}"class="inputstyle" name="price"></td>
                        <td><input type="text" value="${cars.rent}"class="inputstyle" name="rent"></td>
                        <td>
                                <c:if test="${cars.status == 0}">
                                    未出租
                                    <input type="hidden" value="未出租" name="status">
                                </c:if>

                                <c:if test="${cars.status == 1}">
                                    出租
                                    <input type="hidden" value="出租" name="status">
                                </c:if>

                        </td>
                        <td><select name="useAble">
                            <c:if test="${cars.useAble == 0}">
                                <option selected="selected">可用</option>
                                <option>不可用</option>
                            </c:if>

                            <c:if test="${cars.useAble == 1}">
                                <option>可用</option>
                                <option selected="selected">不可用</option>
                            </c:if>
                        </select>
                        </td>
                        </c:if>
                        <td><input type="submit"></td>
                    </form>
                </tr>


            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        </table>
    </div>
</div>
</body>
</html>
